package com.zhijian.medical.service;

import com.zhijian.medical.entity.po.ProductSendOutDetail;
import com.zhijian.medical.entity.vo.request.ProductSendOutDetailSearchVo;
import com.zhijian.medical.entity.vo.response.ProductSendOutDetailVo;
import com.zhijian.medical.util.Page;

import java.util.List;

/**
 * 产品发货填写表单 业务处理层
 *
 * @author HCG
 * @version 1.0
 * @date 2022-03-19 22:54:07
 */
public interface ProductSendOutDetailService {

    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    ProductSendOutDetail selectById(Long id);

    /**
     * 主键查询vo
     *
     * @param id
     * @return
     */
    ProductSendOutDetailVo selectVoById(Long id);

    /**
     * 根据发货号查询单个发货详情
     *
     * @param code
     * @return
     */
    ProductSendOutDetailVo selectVoByCode(String code);

    /**
     * 按照主键删除
     *
     * @param id
     */
    void deleteById(Long id);

    /**
     * 新增
     *
     * @param productSendOutDetail
     * @return
     */
    Long insert(ProductSendOutDetail productSendOutDetail);

    /**
     * 更改
     *
     * @param productSendOutDetail
     * @return
     */
    boolean update(ProductSendOutDetail productSendOutDetail);

    /**
     * 总数
     *
     * @param productSendOutDetailSearchVo
     * @return
     */
    Integer count(ProductSendOutDetailSearchVo productSendOutDetailSearchVo);

    /**
     * 列表
     *
     * @param productSendOutDetailSearchVo
     * @return
     */
    List<ProductSendOutDetailVo> selectList(ProductSendOutDetailSearchVo productSendOutDetailSearchVo);

    /**
     * 分页查询
     *
     * @param productSendOutDetailSearchVo
     * @return
     */
    Page<ProductSendOutDetailVo> selectPage(ProductSendOutDetailSearchVo productSendOutDetailSearchVo);

    /**
     * 确认收货
     *
     * @param personId
     * @param id
     * @return
     */
    boolean harvest(Long personId, Long id);

    /**
     * 汇总发货数量
     *
     * @param productSendOutDetailSearchVo
     * @return
     */
    int sumQuantity(ProductSendOutDetailSearchVo productSendOutDetailSearchVo);
}